import { power } from './totest'
let { assert } = require('chai')
let { describe, it } = require('mocha')

describe('pow', function () {
  describe('raises x to power n', function () {
    function makeTest (x) {
      let expected = x * x * x
      it(`${x} in the power 3 is ${expected}`, function () {
        assert.equal(power(x, 3), expected)
      })
    }

    for (let x = 1; x <= 5; x++) {
      makeTest(x)
    }
  })

  // it('for negative n the result is NaN', function () {
  // assert.isNaN(pow(2, -1))
  // })

  // it('for non-integer n the result is NaN', function () {
  // assert.isNaN(pow(2, 1.5))
  // })

  // ...可以在这里写更多的测试代码，describe 和 it 都可以添加。
})
